package com.common.help.test01;

public class Player {
	
	private Double totalAmount = 0D;//累计消费
	private Double amount = 0D;//单笔消费
	//private CalPrice calPrice = new Orgnic();//每个客户都有一个计算价格的策略，初始都是普通计算，即原价
	private CalPrice calPrice;
	public void buy(Double money){
		this.amount = money;
		this.totalAmount +=money;
		
		calPrice = CalPriceFactory.factoryPrice(this);
	}
	
	//计算客户最终要付的钱
    public Double calLastAmount() {
        return calPrice.calPrice(amount);
    }

	public Double getTotalAmount() {
		return totalAmount;
	}
    
    
}
